local wuxingguitian = fk.CreateSkill {
  name = "lingling__wuxingguitian",
  tags = { Skill.Compulsory }
}

Fk:loadTranslationTable {
  ["lingling__wuxingguitian"] = "五行归天",
  [":lingling__wuxingguitian"] = "锁定技，防止你受到的伤害，第五轮结束时，你死亡。",
}

wuxingguitian:addEffect(fk.DamageInflicted, {
  anim_type = "defensive",
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(wuxingguitian.name) and target == player
  end,
  on_use = function(self, event, target, player, data)
    data:preventDamage()
  end
})

wuxingguitian:addEffect(fk.RoundEnd, {
  anim_type = "negative",
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(wuxingguitian.name) and player.room:getBanner("RoundCount") == 5
  end,
  on_use = function(self, event, target, player, data)
    player.room:killPlayer({ who = player })
  end
})

return wuxingguitian
